﻿// MyNotes - Free Sticky Notes
// Copyright (C) 2011 Alexandre Vicenzi
// 
// This program is free software; you can redistribute it and/or modify it under 
// the terms of the GNU General Public License as published by the Free Software 
// Foundation; either version 3 of the License, or (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful, but WITHOUT 
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with 
// this program; if not, write to the Free Software Foundation, Inc., 
// 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyNotes
{
    class Translate
    {
        private static string translationFile = "/lang/enu.lng";
        private static string languageName = "English";
        private static string nativeName = "English";
        private static string ISO639_2Code = "ENU";

        public Translate()
        {

        }

        public static void LoadDefaultLanguage()
        {
            TranslationFile = "/lang/enu.lng";
            LanguageName = "English";
            LanguageNativeName = "English";
            ISO6392Code = "ENU";
            
        }

        public static string TransStr(string id, string str)
        {
            return TransStr(id, str, TranslationFile);
        }

        public static string TransStr(string id, string str, string isoCode)
        {
            if (isoCode.Equals("ENU"))
                return str;
            else
                return ParseXML.GetTranslatioByTag(id, TranslationFile);
        }

        public static List<string> GetAllSupportedLanguages()
        {
            return ParseXML.GetAllLanguages();
        }

        #region Fields

        public static string TranslationFile
        {
            get { return translationFile; }
            set { translationFile = value; }
        }
        public static string LanguageName
        {
            get { return languageName; }
            set { languageName = value; }
        }
        public static string LanguageNativeName
        {
            get { return nativeName; }
            set { nativeName = value; }
        }
        public static string ISO6392Code
        {
            get { return ISO639_2Code; }
            set { ISO639_2Code = value; }
        }


        #endregion
    }
}